package com.ctsi.question.dto;

import com.ctsi.commons.util.UtilDateTime;
import com.ctsi.commons.util.UtilValidate;
import com.ctsi.question.entity.WeekReportDetailEntity;

import java.io.Serializable;

/**
 * 添加周报详情
 */
public class AddReportDetails implements Serializable {

    private String id;

    /**
     * 周报ID
     */
    private String weekReportId;
    /**
     * 工作类型
     */
    private String jobType;
    /**
     * 工作内容
     */
    private String jobContent;
    /**
     * 未完成说明
     */
    private String noCompleteReason;
    /**
     * 项目编号
     */
    private String projectCode;
    /**
     * 项目完成进度
     */
    private Integer complateRate;
    /**
     * 预计完成时间
     */
    private String expectComplateTime;
    /**
     * 关键进展点
     */
    private String mainPoint;
    /**
     * 自我评价
     */
    private String selfEval;

    public AddReportDetails() {
    }

    public String getWeekReportId() {
        return weekReportId;
    }

    public void setWeekReportId(String weekReportId) {
        this.weekReportId = weekReportId;
    }

    public String getJobType() {
        return jobType;
    }

    public void setJobType(String jobType) {
        this.jobType = jobType;
    }

    public String getJobContent() {
        return jobContent;
    }

    public void setJobContent(String jobContent) {
        this.jobContent = jobContent;
    }

    public String getNoCompleteReason() {
        return noCompleteReason;
    }

    public void setNoCompleteReason(String noCompleteReason) {
        this.noCompleteReason = noCompleteReason;
    }

    public String getProjectCode() {
        return projectCode;
    }

    public void setProjectCode(String projectCode) {
        this.projectCode = projectCode;
    }

    public Integer getComplateRate() {
        return complateRate;
    }

    public void setComplateRate(Integer complateRate) {
        this.complateRate = complateRate;
    }

    public String getExpectComplateTime() {
        return expectComplateTime;
    }

    public void setExpectComplateTime(String expectComplateTime) {
        this.expectComplateTime = expectComplateTime;
    }

    public String getMainPoint() {
        return mainPoint;
    }

    public void setMainPoint(String mainPoint) {
        this.mainPoint = mainPoint;
    }

    public String getSelfEval() {
        return selfEval;
    }

    public void setSelfEval(String selfEval) {
        this.selfEval = selfEval;
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    /**
     * @param isCharge 是否是责任人
     * @return
     */
    public WeekReportDetailEntity toWeekReportDetailEntity(boolean isCharge){
        WeekReportDetailEntity detail = new WeekReportDetailEntity();
        detail.setId(this.id);
        detail.setWeekReportId(this.weekReportId);
        detail.setJobType(this.jobType);
        detail.setJobContent(this.jobContent);
        detail.setNoCompleteReason(this.noCompleteReason);
        detail.setProjectCode(this.projectCode);
        if (isCharge) {
            detail.setComplateRate(this.complateRate);
        }
        if (UtilValidate.isNotEmpty(this.expectComplateTime)) {
            detail.setExpectComplateTime(UtilDateTime.toLong(this.expectComplateTime));
        }
        detail.setSelfEval(this.selfEval);
        detail.setMainPoint(this.mainPoint);
        return detail;
    }
}
